package org.raymond.iworks.study.basic.designpattern.principle.dependenceinversion;

public class DependenceInversion2 {
    public static void main(String[] args) {
        Person1 p1 = new Person1();
        p1.receive(new Email1());
    }
}

interface IReceiver {
    String info();
}

class Email1 implements IReceiver {
    public String info(){
        return "email info: hello world!";
    }
}

class Person1 {
    public void receive(Email1 email){
        System.out.println(email.info());
    }
}
